-- apprentice
-- created by panyl
-- 地牢格子：学徒

return {
    restoreGrid = function(grid, info)

    end,

    -- 营救了某层学徒
    rescueRecord = function(dungeonId, layer)
        -- 改成是否可以解救冈布奥
        local apprentice = DungeonAreaM.query(dungeonId, "apprentice") or {};

        local index = table.indexOf(apprentice, layer);
        if index <= 0 then
            return;
        end

        local record = ME.user.dbase:query("apprentice_rescue", {});
        local flag = record[dungeonId] or 0;

        index = bit.blshift(1, index - 1);
        flag = bit.bor(flag, index);

        record[dungeonId] = flag;
        ME.user.dbase:set("apprentice_rescue", record);
    end,
};
